package com.mall.orders.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.model.domain.OmsOrderReturnReason;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;


public interface OmsOrderReturnReasonMapper  {

    List<OmsOrderReturnReason> selectAll(Integer pageNum, Integer pageSize);

    @Select("select count(*) from oms_order_return_reason")
    int selectCount();

    @Select("select * from oms_order_return_reason where id = #{id}")
    OmsOrderReturnReason selectById(Integer id);

    void updateById(Integer id, @Param("returnReason") OmsOrderReturnReason returnReason);

    void updateStatus(@Param("list") List<Integer> ids, @Param("status") Integer status);

    @Insert("INSERT INTO oms_order_return_reason(name, sort, status,create_time) values (#{omsOrderReturnReason.name},#{omsOrderReturnReason.sort},#{omsOrderReturnReason.status},#{omsOrderReturnReason.createTime})")
    void insert(@Param("omsOrderReturnReason") OmsOrderReturnReason omsOrderReturnReason);

    void deleteBatchIds(List<Integer> ids);
}




